# puppy_icon_theme
# Builds from https://github.com/puppylinux-woof-CE/petbuilds
# File auto generated by ./mk_petbuild.sh. Edit as necessary.

. ../func
. ../build.conf

export THEME="Puppy Standard"
URL=https://github.com/puppylinux-woof-CE/puppy_icon_theme/archive
PKG=puppy_icon_theme
VER=0.8
COMP=tar.gz
DESC="Puppy GTK compatible Icon Theme"
DEPS=
CAT=BuildingBlock
DESKTOP=puppy_icon_theme.desktop
BUILD=all
CWD=$(pwd)
[ -z "$MWD" ] && MWD=$(dirname $CWD)
[ -z "$BUILD" ] && BUILD=$DEF_BUILD
# comment these 2 below if you use a custom package() function
#[ -f "$DESKTOP" ] || DESKTOP=not
#[ -z "$DEPS" ] && DEPS=not

ARCH=$(uname -m)
case $ARCH in # set in build.conf
 *64) 	LIBDIR=$LIBCONF64 ;;
 arm*)	LIBDIR=$LIBCONFarm;;
 *) 	LIBDIR=$LIBCONF32 ;;
esac

build() {
	mv ${PKG}-${PKG}-${VER} ${PKG}-${VER}
	cd ${PKG}-${VER}
	make
	make DESTDIR=${CWD}/${PKG}-install install
	cd -
}

package() {
	mv ${PKG}-install ${PKG}-${VER}-noarch_${BUILD}
	cp -af pinstall.sh ${PKG}-${VER}-noarch_${BUILD}/
	chmod 755 ${PKG}-${VER}-noarch_${BUILD}/pinstall.sh
	mkdir -p ${PKG}_DEV-${VER}-noarch_${BUILD}/usr/src/dev/
	cat puppy_icon_theme.petbuild > ${PKG}_DEV-${VER}-noarch_${BUILD}/usr/src/dev/${PKG}-build-recipe
	for p in $(ls|grep "noarch") ; do
		case $p in
			*_DEV*) DESC="$PKG development"; DEPS=+${PKG} ;;
			*_DOC*) DESC="$PKG documentation"; DEPS=+${PKG} ;;
			*_NLS*) DESC="$PKG locales"; DEPS=+${PKG} ;;
		esac	
		echo "packaging $p"	
		dir2pet -x -s -w="$DESC" -d="$DEPS" -c="$CAT" -p=${p} 2>&1 >/dev/null
		rm -r $p
		mv ${p}.pet ../0pets_out/
	done
	#rm -r ${PKG}-install
	rm -r ${PKG}-${VER}
	#mv -f *.files ../0logs/
	echo "done!"
}

# main
retrieve ${PKG}-${VER}.${COMP}
extract ${PKG}-${VER}.${COMP}
build
package
